<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Win32k: mnpopup.c 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Win32k
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00788.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">宏定义</a> &#124;
<a href="#func-members">函数</a>  </div>
  <div class="headertitle">
<div class="title">mnpopup.c 文件参考</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="a03629_source.html">precomp.h</a>&quot;</code><br />
</div>
<p><a href="a00788_source.html">浏览源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
宏定义</h2></td></tr>
<tr class="memitem:a03fc6648451bec31b72dc096a18dbf6a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00788.html#a03fc6648451bec31b72dc096a18dbf6a">RECT_ONLEFT</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:a03fc6648451bec31b72dc096a18dbf6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4e2a1eb4f026734ecfcc22af567fbf6f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00788.html#a4e2a1eb4f026734ecfcc22af567fbf6f">RECT_ONTOP</a>&#160;&#160;&#160;1</td></tr>
<tr class="separator:a4e2a1eb4f026734ecfcc22af567fbf6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3d61a7157cb1c15d4a6e71776948b59"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00788.html#ab3d61a7157cb1c15d4a6e71776948b59">RECT_ONRIGHT</a>&#160;&#160;&#160;2</td></tr>
<tr class="separator:ab3d61a7157cb1c15d4a6e71776948b59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1eb26f411538728dea46c5b6157046b9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00788.html#a1eb26f411538728dea46c5b6157046b9">RECT_ONBOTTOM</a>&#160;&#160;&#160;3</td></tr>
<tr class="separator:a1eb26f411538728dea46c5b6157046b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab11542c3bfbe0c945e387c7f41830439"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00788.html#ab11542c3bfbe0c945e387c7f41830439">RECT_ORG</a>&#160;&#160;&#160;4</td></tr>
<tr class="separator:ab11542c3bfbe0c945e387c7f41830439"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:a02a4ecd8aec6051ff2fa9b50d7423650"><td class="memItemLeft" align="right" valign="top">BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00788.html#a02a4ecd8aec6051ff2fa9b50d7423650">TryRect</a> (<a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> wRect, int x, int y, int cx, int <a class="el" href="a00716.html#ac7b5fb8555805e7e7c11b30491a324f7">cy</a>, LPRECT prcExclude, LPPOINT ppt)</td></tr>
<tr class="separator:a02a4ecd8aec6051ff2fa9b50d7423650"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a46af5561ebb94b5224409ea068e90d37"><td class="memItemLeft" align="right" valign="top">LONG&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00788.html#a46af5561ebb94b5224409ea068e90d37">FindBestPos</a> (int x, int y, int cx, int <a class="el" href="a00716.html#ac7b5fb8555805e7e7c11b30491a324f7">cy</a>, LPRECT prcExclude, <a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> wFlags)</td></tr>
<tr class="separator:a46af5561ebb94b5224409ea068e90d37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78f83274b72cf27d2b86910febfc7d0c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00788.html#a78f83274b72cf27d2b86910febfc7d0c">xxxTrackPopupMenuEx</a> (<a class="el" href="a00365.html#af18dd4dd192e00a176acc4dc89084f34">PMENU</a> pMenu, <a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> dwFlags, int x, int y, <a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a> pwndOwner, LPTPMPARAMS lpTpm)</td></tr>
<tr class="separator:a78f83274b72cf27d2b86910febfc7d0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">宏定义说明</h2>
<a id="a1eb26f411538728dea46c5b6157046b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1eb26f411538728dea46c5b6157046b9">&#9670;&nbsp;</a></span>RECT_ONBOTTOM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RECT_ONBOTTOM&#160;&#160;&#160;3</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00788_source.html">mnpopup.c</a> 第 <a class="el" href="a00788_source.html#l00019">19</a> 行定义.</p>

</div>
</div>
<a id="a03fc6648451bec31b72dc096a18dbf6a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a03fc6648451bec31b72dc096a18dbf6a">&#9670;&nbsp;</a></span>RECT_ONLEFT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RECT_ONLEFT&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00788_source.html">mnpopup.c</a> 第 <a class="el" href="a00788_source.html#l00016">16</a> 行定义.</p>

</div>
</div>
<a id="ab3d61a7157cb1c15d4a6e71776948b59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab3d61a7157cb1c15d4a6e71776948b59">&#9670;&nbsp;</a></span>RECT_ONRIGHT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RECT_ONRIGHT&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00788_source.html">mnpopup.c</a> 第 <a class="el" href="a00788_source.html#l00018">18</a> 行定义.</p>

</div>
</div>
<a id="a4e2a1eb4f026734ecfcc22af567fbf6f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4e2a1eb4f026734ecfcc22af567fbf6f">&#9670;&nbsp;</a></span>RECT_ONTOP</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RECT_ONTOP&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00788_source.html">mnpopup.c</a> 第 <a class="el" href="a00788_source.html#l00017">17</a> 行定义.</p>

</div>
</div>
<a id="ab11542c3bfbe0c945e387c7f41830439"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab11542c3bfbe0c945e387c7f41830439">&#9670;&nbsp;</a></span>RECT_ORG</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RECT_ORG&#160;&#160;&#160;4</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00788_source.html">mnpopup.c</a> 第 <a class="el" href="a00788_source.html#l00020">20</a> 行定义.</p>

</div>
</div>
<h2 class="groupheader">函数说明</h2>
<a id="a46af5561ebb94b5224409ea068e90d37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a46af5561ebb94b5224409ea068e90d37">&#9670;&nbsp;</a></span>FindBestPos()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LONG FindBestPos </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>cx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>cy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LPRECT&#160;</td>
          <td class="paramname"><em>prcExclude</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>&#160;</td>
          <td class="paramname"><em>wFlags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00788_source.html">mnpopup.c</a> 第 <a class="el" href="a00788_source.html#l00384">384</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;{</div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;    <span class="keywordtype">int</span> iRect;</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;    <span class="keywordtype">int</span> iT;</div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> awRect[4];</div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;    POINT ptT;</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;    RECT rcExclude;</div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160; </div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;    <span class="comment">// Clip our coords on screen first.  We use the same algorithm to clip</span></div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;    <span class="comment">// as in Win3.1 for dudes with no exclude rect.</span></div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160; </div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;    <span class="keywordflow">if</span> (prcExclude!=NULL)</div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;    {</div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;        <span class="comment">// Clip exclude rect to screen!</span></div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;        <a class="code" href="a00935.html#a31ccccdb469eefbb55d18b71a26af0da">CopyRect</a>(&amp;rcExclude, prcExclude);</div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;        <a class="code" href="a00935.html#a1c87c29903dd37145cd93b64140a5d3a">IntersectRect</a>(&amp;rcExclude, &amp;rcExclude, &amp;<a class="code" href="a03257.html#ab597263bdbb3441715804712fcf29e6d">gpDispInfo</a>-&gt;<a class="code" href="a02605.html#a263f5b35c44d9f9ae5c74acae8037644">rcScreen</a>);</div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;    }</div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;        <a class="code" href="a00935.html#a479bbe69c871894f6ca23dfa237481ad">SetRect</a>(&amp;rcExclude, x, y, x, y);</div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160; </div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;<span class="preprocessor">#ifdef MEMPHIS_MENU_ANIMATION</span></div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;    ppopupmenu-&gt;iDropDir = PAS_OUT | PAS_RIGHT;</div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;<span class="preprocessor">#endif // MEMPHIS_MENU_ANIMATION</span></div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160; </div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;    <span class="keywordflow">if</span> (x + cx &gt; <a class="code" href="a03257.html#ab597263bdbb3441715804712fcf29e6d">gpDispInfo</a>-&gt;<a class="code" href="a02605.html#a263f5b35c44d9f9ae5c74acae8037644">rcScreen</a>.right) {</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;        <span class="keywordflow">if</span> (prcExclude!=NULL)</div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;            x = rcExclude.right;</div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160; </div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;        x -= cx;</div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;<span class="preprocessor">#ifdef MEMPHIS_MENU_ANIMATION</span></div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;    ppopupmenu-&gt;iDropDir = PAS_OUT | PAS_LEFT;</div>
<div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;<span class="preprocessor">#endif // MEMPHIS_MENU_ANIMATION</span></div>
<div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;    }</div>
<div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;    x = max(x, 0);</div>
<div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160; </div>
<div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;    y = max(0, min(y, <a class="code" href="a03257.html#ab597263bdbb3441715804712fcf29e6d">gpDispInfo</a>-&gt;<a class="code" href="a02605.html#a263f5b35c44d9f9ae5c74acae8037644">rcScreen</a>.bottom-<a class="code" href="a00716.html#ac7b5fb8555805e7e7c11b30491a324f7">cy</a>));</div>
<div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;    <span class="comment">// Try first point</span></div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a00788.html#a02a4ecd8aec6051ff2fa9b50d7423650">TryRect</a>(<a class="code" href="a00788.html#ab11542c3bfbe0c945e387c7f41830439">RECT_ORG</a>, x, y, cx, <a class="code" href="a00716.html#ac7b5fb8555805e7e7c11b30491a324f7">cy</a>, &amp;rcExclude, &amp;ptT))</div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;        <span class="keywordflow">goto</span> FOUND;</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160; </div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;    <span class="comment">// Sort possibilities.  Get offset of horizontal rects.</span></div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;    iRect = (wFlags &amp; TPM_VERTICAL) ? 2 : 0;</div>
<div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160; </div>
<div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;    <span class="comment">// Sort horizontally.  Note that we treat TPM_CENTERALIGN like</span></div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;    <span class="comment">// TPM_LEFTALIGN.</span></div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;    <span class="comment">// If we&#39;re right-aligned, try to right-align on left side first.</span></div>
<div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;    <span class="comment">// Otherwise, try to left-align on right side first.</span></div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;    iT = (wFlags &amp; TPM_RIGHTALIGN) ? 0 : 2;</div>
<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160; </div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;    awRect[0 + iRect] = <a class="code" href="a00788.html#a03fc6648451bec31b72dc096a18dbf6a">RECT_ONLEFT</a> + iT;</div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;    awRect[1 + iRect] = <a class="code" href="a00788.html#ab3d61a7157cb1c15d4a6e71776948b59">RECT_ONRIGHT</a> - iT;</div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160; </div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;    <span class="comment">// Sort vertically.  Note that we treat TPM_VCENTERALIGN like</span></div>
<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;    <span class="comment">// TPM_TOPALIGN.</span></div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;    <span class="comment">// If we&#39;re bottom-aligned, try to bottom-align with top of rect</span></div>
<div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;    <span class="comment">// first.  Otherwise, try to top-align with bottom of exclusion first.</span></div>
<div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;    iT = (wFlags &amp; TPM_BOTTOMALIGN) ? 0 : 2;</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160; </div>
<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;    awRect[2 - iRect] = <a class="code" href="a00788.html#a4e2a1eb4f026734ecfcc22af567fbf6f">RECT_ONTOP</a> + iT;</div>
<div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;    awRect[3 - iRect] = <a class="code" href="a00788.html#a1eb26f411538728dea46c5b6157046b9">RECT_ONBOTTOM</a> - iT;</div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160; </div>
<div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;    <span class="comment">// Loop through sorted alternatives.  Note that TryRect fails immediately</span></div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;    <span class="comment">// if an exclusion coordinate is too close to screen edge.</span></div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160; </div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;    <span class="keywordflow">for</span> (iRect = 0; iRect &lt; 4; iRect++) {</div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="a00788.html#a02a4ecd8aec6051ff2fa9b50d7423650">TryRect</a>(awRect[iRect], x, y, cx, <a class="code" href="a00716.html#ac7b5fb8555805e7e7c11b30491a324f7">cy</a>, &amp;rcExclude, &amp;ptT)) {</div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;<span class="preprocessor">#ifdef MEMPHIS_MENU_ANIMATION</span></div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;            <span class="keywordflow">switch</span> (awRect[iRect])</div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;            {</div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;                <span class="keywordflow">case</span> <a class="code" href="a00788.html#a4e2a1eb4f026734ecfcc22af567fbf6f">RECT_ONTOP</a>:    ppopupmenu-&gt;iDropDir = PAS_OUT | PAS_UP;    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;                <span class="keywordflow">case</span> <a class="code" href="a00788.html#a03fc6648451bec31b72dc096a18dbf6a">RECT_ONLEFT</a>:   ppopupmenu-&gt;iDropDir = PAS_OUT | PAS_LEFT;  <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;                <span class="keywordflow">case</span> <a class="code" href="a00788.html#a1eb26f411538728dea46c5b6157046b9">RECT_ONBOTTOM</a>: ppopupmenu-&gt;iDropDir = PAS_OUT | PAS_DOWN;  <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;                <span class="keywordflow">case</span> <a class="code" href="a00788.html#ab3d61a7157cb1c15d4a6e71776948b59">RECT_ONRIGHT</a>:  ppopupmenu-&gt;iDropDir = PAS_OUT | PAS_RIGHT; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;            }</div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;<span class="preprocessor">#endif // MEMPHIS_MENU_ANIMATION</span></div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;            x = ptT.x;</div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;            y = ptT.y;</div>
<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;        }</div>
<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;    }</div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160; </div>
<div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;FOUND:</div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;    <span class="keywordflow">return</span> MAKELONG(x, y);</div>
<div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00935_source.html#l00391">CopyRect()</a>, <a class="el" href="a00716_source.html#l00456">cy</a>, <a class="el" href="a03257_source.html#l00125">gpDispInfo</a>, <a class="el" href="a00899_source.html#l01978">tagPOPUPMENU::iDropDir</a>, <a class="el" href="a00935_source.html#l00184">IntersectRect()</a>, <a class="el" href="a00365_source.html#l01570">tagDISPLAYINFO::rcScreen</a>, <a class="el" href="a00788_source.html#l00019">RECT_ONBOTTOM</a>, <a class="el" href="a00788_source.html#l00016">RECT_ONLEFT</a>, <a class="el" href="a00788_source.html#l00018">RECT_ONRIGHT</a>, <a class="el" href="a00788_source.html#l00017">RECT_ONTOP</a>, <a class="el" href="a00788_source.html#l00020">RECT_ORG</a>, <a class="el" href="a00935_source.html#l00021">SetRect()</a>, <a class="el" href="a00788_source.html#l00502">TryRect()</a> , 以及 <a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT()</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a00788_source.html#l00052">xxxTrackPopupMenuEx()</a>.</p>

</div>
</div>
<a id="a02a4ecd8aec6051ff2fa9b50d7423650"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a02a4ecd8aec6051ff2fa9b50d7423650">&#9670;&nbsp;</a></span>TryRect()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL TryRect </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>&#160;</td>
          <td class="paramname"><em>wRect</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>cx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>cy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LPRECT&#160;</td>
          <td class="paramname"><em>prcExclude</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LPPOINT&#160;</td>
          <td class="paramname"><em>ppt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00788_source.html">mnpopup.c</a> 第 <a class="el" href="a00788_source.html#l00502">502</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;{</div>
<div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;    RECT rcTry;</div>
<div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160; </div>
<div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;    <span class="keywordflow">switch</span> (wRect) {</div>
<div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;        <span class="keywordflow">case</span> <a class="code" href="a00788.html#ab3d61a7157cb1c15d4a6e71776948b59">RECT_ONRIGHT</a>:</div>
<div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160;            x = prcExclude-&gt;right;</div>
<div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;            <span class="keywordflow">if</span> (x + cx &gt; <a class="code" href="a03257.html#ab597263bdbb3441715804712fcf29e6d">gpDispInfo</a>-&gt;<a class="code" href="a02605.html#a263f5b35c44d9f9ae5c74acae8037644">rcScreen</a>.right)</div>
<div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;                <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160; </div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;        <span class="keywordflow">case</span> <a class="code" href="a00788.html#a1eb26f411538728dea46c5b6157046b9">RECT_ONBOTTOM</a>:</div>
<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;            y = prcExclude-&gt;bottom;</div>
<div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;            <span class="keywordflow">if</span> (y + <a class="code" href="a00716.html#ac7b5fb8555805e7e7c11b30491a324f7">cy</a> &gt; <a class="code" href="a03257.html#ab597263bdbb3441715804712fcf29e6d">gpDispInfo</a>-&gt;<a class="code" href="a02605.html#a263f5b35c44d9f9ae5c74acae8037644">rcScreen</a>.bottom)</div>
<div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;                <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160; </div>
<div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;        <span class="keywordflow">case</span> <a class="code" href="a00788.html#a03fc6648451bec31b72dc096a18dbf6a">RECT_ONLEFT</a>:</div>
<div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;            x = prcExclude-&gt;left - cx;</div>
<div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160;            <span class="keywordflow">if</span> (x &lt; 0)</div>
<div class="line"><a name="l00523"></a><span class="lineno">  523</span>&#160;                <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160; </div>
<div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;        <span class="keywordflow">case</span> <a class="code" href="a00788.html#a4e2a1eb4f026734ecfcc22af567fbf6f">RECT_ONTOP</a>:</div>
<div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;            y = prcExclude-&gt;top - <a class="code" href="a00716.html#ac7b5fb8555805e7e7c11b30491a324f7">cy</a>;</div>
<div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;            <span class="keywordflow">if</span> (y &lt; 0)</div>
<div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;                <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160; </div>
<div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;        <span class="comment">//</span></div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;        <span class="comment">// case RECT_ORG:</span></div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;        <span class="comment">//      NOP;</span></div>
<div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;        <span class="comment">//      break;</span></div>
<div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;        <span class="comment">//</span></div>
<div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;    }</div>
<div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160; </div>
<div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;    ppt-&gt;x = x;</div>
<div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;    ppt-&gt;y = y;</div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160; </div>
<div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;    rcTry.left      = x;</div>
<div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;    rcTry.top       = y;</div>
<div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;    rcTry.right     = x + cx;</div>
<div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160;    rcTry.bottom    = y + <a class="code" href="a00716.html#ac7b5fb8555805e7e7c11b30491a324f7">cy</a>;</div>
<div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160; </div>
<div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;    <span class="keywordflow">return</span>(!<a class="code" href="a00935.html#a1c87c29903dd37145cd93b64140a5d3a">IntersectRect</a>(&amp;rcTry, &amp;rcTry, prcExclude));</div>
<div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00716_source.html#l00456">cy</a>, <a class="el" href="a03257_source.html#l00125">gpDispInfo</a>, <a class="el" href="a00935_source.html#l00184">IntersectRect()</a>, <a class="el" href="a00365_source.html#l01570">tagDISPLAYINFO::rcScreen</a>, <a class="el" href="a00788_source.html#l00019">RECT_ONBOTTOM</a>, <a class="el" href="a00788_source.html#l00016">RECT_ONLEFT</a>, <a class="el" href="a00788_source.html#l00018">RECT_ONRIGHT</a> , 以及 <a class="el" href="a00788_source.html#l00017">RECT_ONTOP</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a00788_source.html#l00384">FindBestPos()</a>.</p>

</div>
</div>
<a id="a78f83274b72cf27d2b86910febfc7d0c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a78f83274b72cf27d2b86910febfc7d0c">&#9670;&nbsp;</a></span>xxxTrackPopupMenuEx()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int xxxTrackPopupMenuEx </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00365.html#af18dd4dd192e00a176acc4dc89084f34">PMENU</a>&#160;</td>
          <td class="paramname"><em>pMenu</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>&#160;</td>
          <td class="paramname"><em>dwFlags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a>&#160;</td>
          <td class="paramname"><em>pwndOwner</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LPTPMPARAMS&#160;</td>
          <td class="paramname"><em>lpTpm</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00788_source.html">mnpopup.c</a> 第 <a class="el" href="a00788_source.html#l00052">52</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;{</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <a class="code" href="a02885.html">PMENUSTATE</a> pMenuState;</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndHierarchy;</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <a class="code" href="a02837.html">PPOPUPMENU</a> ppopupMenuHierarchy;</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    LONG sizeHierarchy;</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keywordtype">int</span>         cxPopup, cyPopup;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    BOOL        fSync;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keywordtype">int</span>         cmd;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    BOOL fButtonDown;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <a class="code" href="a01881.html">TL</a> tlpwndHierarchy;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <a class="code" href="a01881.html">TL</a> tlpwndT;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    RECT rcExclude;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiCurrent, ptiOwner;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="preprocessor">#ifdef MEMPHIS_MENUS</span></div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <a class="code" href="a02885.html">PMENUSTATE</a> pmnStateSaved;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    BOOL fSaved = FALSE;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;<span class="preprocessor">#endif // MEMPHIS_MENUS</span></div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <a class="code" href="a00899.html#a70b09c3e2b495630f4205d34be505afb">CheckLock</a>(pMenu);</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <a class="code" href="a00899.html#a70b09c3e2b495630f4205d34be505afb">CheckLock</a>(pwndOwner);</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="comment">     * Capture the things we care about in case lpTpm goes away.</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <span class="keywordflow">if</span> (lpTpm != NULL) {</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        <span class="keywordflow">if</span> (lpTpm-&gt;cbSize != <span class="keyword">sizeof</span>(TPMPARAMS)) {</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;            <a class="code" href="a00371.html#ae61d954062a9ece52e350e54cad9a23d">RIPERR0</a>(ERROR_INVALID_PARAMETER, <a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;TrackPopupMenuEx: cbSize is invalid&quot;</span>);</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;            <span class="keywordflow">return</span>(FALSE);</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        }</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        rcExclude = lpTpm-&gt;rcExclude;</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    }</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160; </div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    ptiCurrent = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    ptiOwner = GETPTI(pwndOwner);</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160; </div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="comment">     * Win95 compatibility: pwndOwner must be owned by ptiCurrent.</span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="comment">     * If we make xxxMNStartState fail this case as well (i.e, spwndNotify</span></div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="comment">     *  must be owned by ptiCurrent), then we could simplify the</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="comment">     *  MenuState stuff because a pMenuState would be owned and used by one</span></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="comment">     *  thread only. Win95 doesn&#39;t do that in MNGetPopup (i.e., the active</span></div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="comment">     *  window could be owned by a different thread);  they probably</span></div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="comment">     *  get all messed up if it happens. We also allow it but we handle it OK.</span></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="comment">     * On the other hand though, let&#39;s keep the code in this function that</span></div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="comment">     *  handles this in case we decide to allow this for future generations.</span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keywordflow">if</span> (ptiCurrent != ptiOwner) {</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;xxxTrackPopupMenuEx: pwndOwner not owned by ptiCurrent&quot;</span>);</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    }</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160; </div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="keywordflow">if</span> ((pMenu == NULL)</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;            || (ptiCurrent-&gt;<a class="code" href="a02889.html#a7f41a9bbcd2f30304020b54827564df4">pMenuState</a> != NULL)</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;            || (ptiOwner-&gt;<a class="code" href="a02889.html#a7f41a9bbcd2f30304020b54827564df4">pMenuState</a> != NULL)) {</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="preprocessor">#ifdef MEMPHIS_MENUS</span></div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        <span class="keywordflow">if</span> ( dwFlags &amp; TPM_RECURSE ) {</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="comment">             * There might be several threads involved while working with</span></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="comment">             *  a menu (i.e., two threads are attached; one owns pwndOwner</span></div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="comment">             *  and the other one calls TrackPopupMenu. So just saving</span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="comment">             *  PtiCurrent()-&gt;pMenuState is not enough.</span></div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="comment">             * Also, do we want to go on if pMenu == NULL?</span></div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="comment">             * I&#39;m failing this so these won&#39;t fall through the cracks</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;            <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(!(dwFlags &amp; TPM_RECURSE));</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160; </div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;            pmnStateSaved = ptiCurrent-&gt;<a class="code" href="a02889.html#a7f41a9bbcd2f30304020b54827564df4">pMenuState</a>;</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;            fSaved = TRUE;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="preprocessor">#endif // MEMPHIS_MENUS</span></div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;<span class="comment">             * Allow only one guy to have a popup menu up at a time...</span></div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;            <a class="code" href="a00371.html#ae61d954062a9ece52e350e54cad9a23d">RIPERR0</a>(ERROR_POPUP_ALREADY_ACTIVE, <a class="code" href="a00371.html#ad6b24a3d61abdc148c8751b5c5add686">RIP_VERBOSE</a>, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;<span class="preprocessor"> #ifdef MEMPHIS_MENUS</span></div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;       }</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="preprocessor"> #endif // MEMPHIS_MENUS</span></div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;   }</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160; </div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160; </div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    <span class="comment">// Is button down?</span></div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160; </div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="keywordflow">if</span> (dwFlags &amp; TPM_RIGHTBUTTON)</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    {</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;        fButtonDown = (<a class="code" href="a00365.html#a4f33bf462d284b706f2f453e2bddd203">_GetKeyState</a>(VK_RBUTTON) &amp; 0x8000) != 0;</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        fButtonDown = (<a class="code" href="a00365.html#a4f33bf462d284b706f2f453e2bddd203">_GetKeyState</a>(VK_LBUTTON) &amp; 0x8000) != 0;</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    }</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160; </div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="comment">     * We always have to make this window topmost so FindWindow finds it</span></div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;<span class="comment">     * before the cached global menu window.  Note that there can be problems</span></div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;<span class="comment">     * with NTSD and leaving this window around.</span></div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    pwndHierarchy = xxxCreateWindowEx(</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;            WS_EX_TOOLWINDOW | WS_EX_TOPMOST |</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;            WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE,</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;            (<a class="code" href="a02449.html">PLARGE_STRING</a>)MENUCLASS,</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;            NULL, WS_POPUP | WS_BORDER,</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;            x, y, 100, 100, NULL, NULL, (HANDLE)pwndOwner-&gt;hModule,</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;            (LPVOID)pMenu, pwndOwner-&gt;<a class="code" href="a02581.html#ac18617bb8bdbcb8e9c73e759b9df75eb">dwExpWinVer</a>);</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160; </div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    <span class="keywordflow">if</span> (!pwndHierarchy) {</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;<span class="preprocessor">#ifdef MEMPHIS_MENUS</span></div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;        <span class="comment">/* BUGBUG</span></div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;<span class="comment">         * What about pmnStateSaved? Let&#39;s stop here so this gets fixed someday</span></div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;         <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pwndHierarchy != NULL);</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;<span class="preprocessor">#endif // MEMPHIS_MENUS</span></div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    }</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160; </div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    <span class="comment">// Do this so that old apps don&#39;t get weird borders on tracked popups due</span></div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <span class="comment">// to the app hack used in CreateWindowEx32.</span></div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    ClrWF(pwndHierarchy, WFOLDUI);</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160; </div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    ThreadLockAlways(pwndHierarchy, &amp;tlpwndHierarchy);</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160; </div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;<span class="preprocessor">#ifdef HAVE_MN_GETPPOPUPMENU</span></div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    ppopupMenuHierarchy = (<a class="code" href="a00365.html#afec8825ff7db21bd65d8f584c1578258">PPOPUPMENU</a>)<a class="code" href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a>(pwndHierarchy,</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;                                                MN_GETPPOPUPMENU, 0, 0);</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    ppopupMenuHierarchy = ((<a class="code" href="a00899.html#abe610bfdbc8b5f05880de1fde6ad7abc">PMENUWND</a>)pwndHierarchy)-&gt;ppopupmenu;</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160; </div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160; </div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#abb587688f4c843befaed1078fa4848ac">fDelayedFree</a> = TRUE;</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    Lock(&amp;(ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#a472df270c88db7755093cd3ca1d1dee6">spwndNotify</a>), pwndOwner);</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    Lock(&amp;(ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#ad680eabbc65eb4d160362e2c73a19994">spmenu</a>), pMenu);</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#ae46449093e4c723bbe342adc37e70387">ppopupmenuRoot</a> = ppopupMenuHierarchy;</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#ac9acbfe225a813c1370b19c7ef4fb649">fIsTrackPopup</a>  = TRUE;</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#a6f224e76b29646c1d8337b2156d9fc5d">fFirstClick</a>    = fButtonDown;</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#acf88a80d20516d7ea2cacfb37b3e7aca">fRightButton</a>   = ((dwFlags &amp; TPM_RIGHTBUTTON) != 0);</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#ad9333cb1b437af71a28e7da0aacaeb13">fNoNotify</a>      = ((dwFlags &amp; TPM_NONOTIFY) != 0);</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160; </div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    <span class="keywordflow">if</span> (fSync = (dwFlags &amp; TPM_RETURNCMD))</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;        ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#aac874d59710c49c47082bdcf3ccca806">fSynchronous</a> = TRUE;</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160; </div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#ae51e1bffcb852e729841b4bb15ed17fc">fIsSysMenu</a> =  ((dwFlags &amp; TPM_SYSMENU) != 0);</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160; </div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    <span class="comment">// Set the GlobalPopupMenu variable so that EndMenu works for popupmenus so</span></div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;    <span class="comment">// that WinWart II people can continue to abuse undocumented functions.</span></div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    <span class="comment">// This is nulled out in MNCancel.</span></div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;<span class="comment">     * This is actually needed for cleanup in case this thread ends</span></div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;<span class="comment">     *  execution before we can free the popup. (See xxxDestroyThreadInfo)</span></div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;<span class="comment">     *</span></div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;<span class="comment">     * Note that one thread might own pwndOwner and another one might call</span></div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;<span class="comment">     *  TrackPopupMenu (pretty normal if the two threads are attached). So</span></div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;<span class="comment">     *  properly setting (and initializing) pMenuState is a must here.</span></div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    pMenuState = <a class="code" href="a00794.html#a9b1db027f59c8e18bd5a0ac94f64af25">MNAllocMenuState</a>(ptiCurrent, ptiOwner, ppopupMenuHierarchy);</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    <span class="keywordflow">if</span> (pMenuState == NULL) {</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;<span class="comment">         * Get out. The app never knew we were here so don&#39;t notify it</span></div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;        dwFlags |= TPM_NONOTIFY;</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;        <span class="keywordflow">goto</span> AbortTrackPopupMenuEx;</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    }</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160; </div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;<span class="comment">     * Notify the app we are entering menu mode.  wParam is 1 since this is a</span></div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;<span class="comment">     * TrackPopupMenu.</span></div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160; </div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    <span class="keywordflow">if</span> (!ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#ad9333cb1b437af71a28e7da0aacaeb13">fNoNotify</a>)</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;        <a class="code" href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a>(pwndOwner, WM_ENTERMENULOOP,</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;            (ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#ae51e1bffcb852e729841b4bb15ed17fc">fIsSysMenu</a> ? FALSE : TRUE), 0);</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160; </div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;<span class="comment">     * Send off the WM_INITMENU, set ourselves up for menu mode etc...</span></div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="a00794.html#ab74bfcb3daae3ba0497d19d263c8a7f0">xxxMNStartState</a>(ppopupMenuHierarchy, MOUSEHOLD)) {</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;<span class="comment">         * ppopupMenuHierarchy has been destroyed already; let&#39;s bail</span></div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;        <span class="keywordflow">goto</span> AbortTrackPopupMenuEx;</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    }</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160; </div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    <span class="keywordflow">if</span> (!ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#ad9333cb1b437af71a28e7da0aacaeb13">fNoNotify</a>) {</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;        <a class="code" href="a00899.html#abfae1dfb48db23dcea4494f7990ad6a6">ThreadLock</a>(ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#a472df270c88db7755093cd3ca1d1dee6">spwndNotify</a>, &amp;tlpwndT);</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;        <a class="code" href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a>(ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#a472df270c88db7755093cd3ca1d1dee6">spwndNotify</a>, WM_INITMENUPOPUP,</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;            (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)PtoHq(pMenu), MAKELONG(0, (ppopupMenuHierarchy-&gt;<a class="code" href="a02837.html#ae51e1bffcb852e729841b4bb15ed17fc">fIsSysMenu</a> ? 1: 0)));</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;        ThreadUnlock(&amp;tlpwndT);</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;    }</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160; </div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;<span class="comment">     * Size the menu window if needed...</span></div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    sizeHierarchy = <a class="code" href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a>(pwndHierarchy, MN_SIZEWINDOW, 1, 0);</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160; </div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    <span class="keywordflow">if</span> (!sizeHierarchy) {</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160; </div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;AbortTrackPopupMenuEx:</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;<span class="comment">         * Release the mouse capture we set when we called StartMenuState...</span></div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;        <a class="code" href="a00617.html#a3376b5eb8ec9b507c26d4420b4b52a25">xxxReleaseCapture</a>();</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160; </div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;        <span class="comment">/* Notify the app we have exited menu mode.  wParam is 1 for real</span></div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;<span class="comment">         * tracked popups, not sys menu.  Check wFlags since ppopupHierarchy</span></div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;<span class="comment">         * will be gone.</span></div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;        <span class="keywordflow">if</span> (!(dwFlags &amp; TPM_NONOTIFY))</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;            <a class="code" href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a>(pwndOwner, WM_EXITMENULOOP, ((dwFlags &amp; TPM_SYSMENU) ?</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;                FALSE : TRUE), 0L);</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160; </div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;<span class="comment">         * Make sure we return failure</span></div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        fSync = TRUE;</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;        cmd = FALSE;</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;        <span class="keywordflow">goto</span> CleanupTrackPopupMenuEx;</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;    }</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160; </div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    <span class="comment">// Setup popup window dimensions</span></div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;    cxPopup = LOWORD(sizeHierarchy) + 2*SYSMET(CXFIXEDFRAME);</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    cyPopup = HIWORD(sizeHierarchy) + 2*SYSMET(CYFIXEDFRAME);</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160; </div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;    <span class="comment">// Horizontal alignment</span></div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    <span class="keywordflow">if</span> (dwFlags &amp; TPM_RIGHTALIGN) {</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;        <span class="keywordflow">if</span> (dwFlags &amp; TPM_CENTERALIGN) {</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;            <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;TrackPopupMenuEx:  TPM_CENTERALIGN ignored&quot;</span>);</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;        }</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;<span class="preprocessor">#endif // DEBUG</span></div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160; </div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;        x -= cxPopup;</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dwFlags &amp; TPM_CENTERALIGN)</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;        x -= (cxPopup / 2);</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160; </div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;    <span class="comment">// Vertical alignment</span></div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;    <span class="keywordflow">if</span> (dwFlags &amp; TPM_BOTTOMALIGN) {</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;        <span class="keywordflow">if</span> (dwFlags &amp; TPM_VCENTERALIGN) {</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;            <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;TrackPopupMenuEx:  TPM_VCENTERALIGN ignored&quot;</span>);</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;        }</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;<span class="preprocessor">#endif // DEBUG</span></div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160; </div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;        y -= cyPopup;</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dwFlags &amp; TPM_VCENTERALIGN)</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;        y -= (cyPopup / 2);</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160; </div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;    <span class="comment">// Get coords to move to.</span></div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;    sizeHierarchy = <a class="code" href="a00788.html#a46af5561ebb94b5224409ea068e90d37">FindBestPos</a>(x, y, cxPopup, cyPopup,</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;#ifdef MEMPHIS_MENU_ANIMATION</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;        ((lpTpm != NULL) ? &amp;rcExclude : NULL), dwFlags, ppopupMenuHierarchy);</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;<span class="preprocessor">#else // MEMPHIS_MENU_ANIMATION</span></div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;        ((lpTpm != NULL) ? &amp;rcExclude : NULL), dwFlags);</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;<span class="preprocessor">#endif // MEMPHIS_MENU_ANIMATION</span></div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    <a class="code" href="a00872.html#a71170c4c5e4c60d4bc657fe52eb8d8d2">xxxSetWindowPos</a>(pwndHierarchy, PWND_TOP, LOWORD(sizeHierarchy),</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;         HIWORD(sizeHierarchy), 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160; </div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;    <a class="code" href="a03605.html#aa3b0c33e20363be2ffa1cd10a3d54342">xxxPlayEventSound</a>(L<span class="stringliteral">&quot;MenuPopup&quot;</span>);</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;    <a class="code" href="a00851.html#ae82e6ab5253cf5a51f5e270f6b83ccb7">xxxShowWindow</a>(pwndHierarchy, MAKELONG(SW_SHOWNOACTIVATE, <a class="code" href="a03257.html#a3f749009e2dddfbcdd946cdc60859d5d">gfAnimate</a>));</div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160; </div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160; </div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;    <span class="comment">// We need to return TRUE for compatibility w/ async TrackPopupMenu().</span></div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;    <span class="comment">// It is conceivable that a menu ID could have ID 0, in which case just</span></div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;    <span class="comment">// returning the cmd chosen would return FALSE instead of TRUE.</span></div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160; </div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;    <span class="comment">// If mouse is in client of popup, act like clicked down</span></div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;    pMenuState-&gt;<a class="code" href="a02885.html#a46148f45192618de6eafbf70310e2aee">fButtonDown</a> = fButtonDown;</div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160; </div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;    cmd = <a class="code" href="a00785.html#a0b9931c83f17b4ca58a7ceadd026f611">xxxMNLoop</a>(ppopupMenuHierarchy, pMenuState, 0x7FFFFFFFL, FALSE);</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160; </div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;CleanupTrackPopupMenuEx:</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160; </div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;    <span class="keywordflow">if</span> (ThreadUnlock(&amp;tlpwndHierarchy)) {</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;        <span class="keywordflow">if</span> (!TestWF(pwndHierarchy, WFDESTROYED)) {</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;            <a class="code" href="a00635.html#a5a00338a3147879f7fa0ecb4a938cd8c">xxxDestroyWindow</a>(pwndHierarchy);</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;        }</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;    }</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160; </div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;    <a class="code" href="a00794.html#aa1a0bd0afdbee1ae21b4f429d5e1bee5">MNEndMenuState</a> (TRUE);</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160; </div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;<span class="preprocessor">#ifdef MEMPHIS_MENUS</span></div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;        <span class="keywordflow">if</span> (fSaved)</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;            ptiCurrent-&gt;<a class="code" href="a02889.html#a7f41a9bbcd2f30304020b54827564df4">pMenuState</a> = pmnStateSaved;</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;<span class="preprocessor">#endif // MEMPHIS_MENUS</span></div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160; </div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;    <span class="keywordflow">return</span>(fSync ? cmd : TRUE);</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00731_source.html#l00026">_GetKeyState()</a>, <a class="el" href="a00899.html#a70b09c3e2b495630f4205d34be505afb">CheckLock()</a>, <a class="el" href="a00365_source.html#l01423">tagWND::dwExpWinVer</a>, <a class="el" href="a00563_source.html#l00175">DWORD</a>, <a class="el" href="a00899_source.html#l02247">tagMENUSTATE::fButtonDown</a>, <a class="el" href="a00899_source.html#l01915">tagPOPUPMENU::fDelayedFree</a>, <a class="el" href="a00899_source.html#l01899">tagPOPUPMENU::fFirstClick</a>, <a class="el" href="a00788_source.html#l00384">FindBestPos()</a>, <a class="el" href="a00899_source.html#l01891">tagPOPUPMENU::fIsSysMenu</a>, <a class="el" href="a00899_source.html#l01892">tagPOPUPMENU::fIsTrackPopup</a>, <a class="el" href="a00899_source.html#l01905">tagPOPUPMENU::fNoNotify</a>, <a class="el" href="a00899_source.html#l01896">tagPOPUPMENU::fRightButton</a>, <a class="el" href="a00899_source.html#l01898">tagPOPUPMENU::fSynchronous</a>, <a class="el" href="a03257_source.html#l00019">gfAnimate</a>, <a class="el" href="a00794_source.html#l00324">MNAllocMenuState()</a>, <a class="el" href="a00794_source.html#l00255">MNEndMenuState()</a>, <a class="el" href="a00899_source.html#l02312">tagTHREADINFO::pMenuState</a>, <a class="el" href="a00899_source.html#l01967">tagPOPUPMENU::ppopupmenuRoot</a>, <a class="el" href="a00263_source.html#l00526">PtiCurrent()</a>, <a class="el" href="a00371_source.html#l00030">RIP_VERBOSE</a>, <a class="el" href="a00371_source.html#l00029">RIP_WARNING</a>, <a class="el" href="a00371_source.html#l00119">RIPERR0</a>, <a class="el" href="a00371_source.html#l00131">RIPMSG0</a>, <a class="el" href="a00899_source.html#l01954">tagPOPUPMENU::spmenu</a>, <a class="el" href="a00899_source.html#l01936">tagPOPUPMENU::spwndNotify</a>, <a class="el" href="a00899.html#abfae1dfb48db23dcea4494f7990ad6a6">ThreadLock()</a>, <a class="el" href="a00950_source.html#l00117">UserAssert</a>, <a class="el" href="a00635_source.html#l01273">xxxDestroyWindow()</a>, <a class="el" href="a00785_source.html#l00466">xxxMNLoop()</a>, <a class="el" href="a00794_source.html#l00483">xxxMNStartState()</a>, <a class="el" href="a03605_source.html#l00164">xxxPlayEventSound()</a>, <a class="el" href="a00617_source.html#l00069">xxxReleaseCapture()</a>, <a class="el" href="a00842_source.html#l00613">xxxSendMessage()</a>, <a class="el" href="a00872_source.html#l01169">xxxSetWindowPos()</a> , 以及 <a class="el" href="a00851_source.html#l00081">xxxShowWindow()</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a03614_source.html#l04970">NtUserTrackPopupMenuEx()</a> , 以及 <a class="el" href="a00671_source.html#l01146">xxxDefWindowProc()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aa00371_html_a01c4659626880ba56745765a3580a36b"><div class="ttname"><a href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a></div><div class="ttdeci">#define RIPMSG0(flags, szFmt)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00131">winerrp.h:131</a></div></div>
<div class="ttc" id="aa02889_html_a7f41a9bbcd2f30304020b54827564df4"><div class="ttname"><a href="a02889.html#a7f41a9bbcd2f30304020b54827564df4">tagTHREADINFO::pMenuState</a></div><div class="ttdeci">PMENUSTATE pMenuState</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02312">userk.h:2312</a></div></div>
<div class="ttc" id="aa00785_html_a0b9931c83f17b4ca58a7ceadd026f611"><div class="ttname"><a href="a00785.html#a0b9931c83f17b4ca58a7ceadd026f611">xxxMNLoop</a></div><div class="ttdeci">int xxxMNLoop(PPOPUPMENU ppopupmenu, PMENUSTATE pMenuState, LONG lParam, BOOL fDblClk)</div><div class="ttdef"><b>Definition:</b> <a href="a00785_source.html#l00466">mnloop.c:466</a></div></div>
<div class="ttc" id="aa02837_html_a472df270c88db7755093cd3ca1d1dee6"><div class="ttname"><a href="a02837.html#a472df270c88db7755093cd3ca1d1dee6">tagPOPUPMENU::spwndNotify</a></div><div class="ttdeci">struct tagWND * spwndNotify</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01936">userk.h:1936</a></div></div>
<div class="ttc" id="aa00365_html_a4f33bf462d284b706f2f453e2bddd203"><div class="ttname"><a href="a00365.html#a4f33bf462d284b706f2f453e2bddd203">_GetKeyState</a></div><div class="ttdeci">SHORT _GetKeyState(int vk)</div><div class="ttdef"><b>Definition:</b> <a href="a00731_source.html#l00026">keyboard.c:26</a></div></div>
<div class="ttc" id="aa00794_html_aa1a0bd0afdbee1ae21b4f429d5e1bee5"><div class="ttname"><a href="a00794.html#aa1a0bd0afdbee1ae21b4f429d5e1bee5">MNEndMenuState</a></div><div class="ttdeci">void MNEndMenuState(BOOL fFreePopup)</div><div class="ttdef"><b>Definition:</b> <a href="a00794_source.html#l00255">mnstate.c:255</a></div></div>
<div class="ttc" id="aa00371_html_ad6b24a3d61abdc148c8751b5c5add686"><div class="ttname"><a href="a00371.html#ad6b24a3d61abdc148c8751b5c5add686">RIP_VERBOSE</a></div><div class="ttdeci">#define RIP_VERBOSE</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00030">winerrp.h:30</a></div></div>
<div class="ttc" id="aa00935_html_a479bbe69c871894f6ca23dfa237481ad"><div class="ttname"><a href="a00935.html#a479bbe69c871894f6ca23dfa237481ad">SetRect</a></div><div class="ttdeci">BOOL APIENTRY SetRect(LPRECT prc, int left, int top, int right, int bottom)</div><div class="ttdef"><b>Definition:</b> <a href="a00935_source.html#l00021">rect.c:21</a></div></div>
<div class="ttc" id="aa02885_html_a46148f45192618de6eafbf70310e2aee"><div class="ttname"><a href="a02885.html#a46148f45192618de6eafbf70310e2aee">tagMENUSTATE::fButtonDown</a></div><div class="ttdeci">DWORD fButtonDown</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02247">userk.h:2247</a></div></div>
<div class="ttc" id="aa02837_html_ad680eabbc65eb4d160362e2c73a19994"><div class="ttname"><a href="a02837.html#ad680eabbc65eb4d160362e2c73a19994">tagPOPUPMENU::spmenu</a></div><div class="ttdeci">struct tagMENU * spmenu</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01954">userk.h:1954</a></div></div>
<div class="ttc" id="aa02449_html"><div class="ttname"><a href="a02449.html">_LARGE_STRING</a></div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00266">user.h:266</a></div></div>
<div class="ttc" id="aa00371_html_a162a73e20dfabca084a3ebb4581631a8"><div class="ttname"><a href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a></div><div class="ttdeci">#define UserAssert(exp)</div><div class="ttdef"><b>Definition:</b> <a href="a00950_source.html#l00117">usersrv.h:117</a></div></div>
<div class="ttc" id="aa02837_html"><div class="ttname"><a href="a02837.html">tagPOPUPMENU</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01880">userk.h:1880</a></div></div>
<div class="ttc" id="aa03605_html_aa3b0c33e20363be2ffa1cd10a3d54342"><div class="ttname"><a href="a03605.html#aa3b0c33e20363be2ffa1cd10a3d54342">xxxPlayEventSound</a></div><div class="ttdeci">VOID xxxPlayEventSound(LPWSTR lpszwSound)</div><div class="ttdef"><b>Definition:</b> <a href="a03605_source.html#l00164">kernel/msgbeep.c:164</a></div></div>
<div class="ttc" id="aa00794_html_ab74bfcb3daae3ba0497d19d263c8a7f0"><div class="ttname"><a href="a00794.html#ab74bfcb3daae3ba0497d19d263c8a7f0">xxxMNStartState</a></div><div class="ttdeci">BOOL xxxMNStartState(PPOPUPMENU ppopupmenu, int mn)</div><div class="ttdef"><b>Definition:</b> <a href="a00794_source.html#l00483">mnstate.c:483</a></div></div>
<div class="ttc" id="aa00842_html_a69cf2e14dcefd941469ad5126e40f79a"><div class="ttname"><a href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a></div><div class="ttdeci">LONG xxxSendMessage(PWND pwnd, UINT message, DWORD wParam, LONG lParam)</div><div class="ttdef"><b>Definition:</b> <a href="a00842_source.html#l00613">sendmsg.c:613</a></div></div>
<div class="ttc" id="aa02837_html_aac874d59710c49c47082bdcf3ccca806"><div class="ttname"><a href="a02837.html#aac874d59710c49c47082bdcf3ccca806">tagPOPUPMENU::fSynchronous</a></div><div class="ttdeci">DWORD fSynchronous</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01898">userk.h:1898</a></div></div>
<div class="ttc" id="aa00257_html_a8315d2c807ba18ba9e528c40614b6173"><div class="ttname"><a href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a></div><div class="ttdeci">PTHREADINFO PtiCurrent(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00263_source.html#l00526">winmgrc.c:526</a></div></div>
<div class="ttc" id="aa00788_html_a46af5561ebb94b5224409ea068e90d37"><div class="ttname"><a href="a00788.html#a46af5561ebb94b5224409ea068e90d37">FindBestPos</a></div><div class="ttdeci">LONG FindBestPos(int x, int y, int cx, int cy, LPRECT prcExclude, UINT wFlags)</div><div class="ttdef"><b>Definition:</b> <a href="a00788_source.html#l00384">mnpopup.c:384</a></div></div>
<div class="ttc" id="aa02837_html_ae51e1bffcb852e729841b4bb15ed17fc"><div class="ttname"><a href="a02837.html#ae51e1bffcb852e729841b4bb15ed17fc">tagPOPUPMENU::fIsSysMenu</a></div><div class="ttdeci">DWORD fIsSysMenu</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01891">userk.h:1891</a></div></div>
<div class="ttc" id="aa00788_html_ab11542c3bfbe0c945e387c7f41830439"><div class="ttname"><a href="a00788.html#ab11542c3bfbe0c945e387c7f41830439">RECT_ORG</a></div><div class="ttdeci">#define RECT_ORG</div><div class="ttdef"><b>Definition:</b> <a href="a00788_source.html#l00020">mnpopup.c:20</a></div></div>
<div class="ttc" id="aa00371_html_ae61d954062a9ece52e350e54cad9a23d"><div class="ttname"><a href="a00371.html#ae61d954062a9ece52e350e54cad9a23d">RIPERR0</a></div><div class="ttdeci">#define RIPERR0(idErr, flags, szFmt)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00119">winerrp.h:119</a></div></div>
<div class="ttc" id="aa00899_html_abfae1dfb48db23dcea4494f7990ad6a6"><div class="ttname"><a href="a00899.html#abfae1dfb48db23dcea4494f7990ad6a6">ThreadLock</a></div><div class="ttdeci">VOID ThreadLock(PVOID pobj, PTL ptl)</div></div>
<div class="ttc" id="aa00935_html_a1c87c29903dd37145cd93b64140a5d3a"><div class="ttname"><a href="a00935.html#a1c87c29903dd37145cd93b64140a5d3a">IntersectRect</a></div><div class="ttdeci">BOOL APIENTRY IntersectRect(LPRECT prcDst, CONST RECT *prcSrc1, CONST RECT *prcSrc2)</div><div class="ttdef"><b>Definition:</b> <a href="a00935_source.html#l00184">rect.c:184</a></div></div>
<div class="ttc" id="aa03257_html_ab597263bdbb3441715804712fcf29e6d"><div class="ttname"><a href="a03257.html#ab597263bdbb3441715804712fcf29e6d">gpDispInfo</a></div><div class="ttdeci">PDISPLAYINFO gpDispInfo</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00125">kernel/globals.c:125</a></div></div>
<div class="ttc" id="aa00794_html_a9b1db027f59c8e18bd5a0ac94f64af25"><div class="ttname"><a href="a00794.html#a9b1db027f59c8e18bd5a0ac94f64af25">MNAllocMenuState</a></div><div class="ttdeci">PMENUSTATE MNAllocMenuState(PTHREADINFO ptiCurrent, PTHREADINFO ptiNotify, PPOPUPMENU ppopupmenuRoot)</div><div class="ttdef"><b>Definition:</b> <a href="a00794_source.html#l00324">mnstate.c:324</a></div></div>
<div class="ttc" id="aa00563_html_a074685e97e89d6aa2accdfcb82328699"><div class="ttname"><a href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a></div><div class="ttdeci">ddeml v[i&lt; inst &gt;][t&lt; type &gt;][hObj|pObj] Dump DDEML state information ddeml lists all ddeml instances for this process n ddeml t&lt; type &gt; lists all ddeml objects of the given type n n assumes link is first DWORD</div><div class="ttdef"><b>Definition:</b> <a href="a00563_source.html#l00175">exts.h:175</a></div></div>
<div class="ttc" id="aa02581_html_ac18617bb8bdbcb8e9c73e759b9df75eb"><div class="ttname"><a href="a02581.html#ac18617bb8bdbcb8e9c73e759b9df75eb">tagWND::dwExpWinVer</a></div><div class="ttdeci">DWORD dwExpWinVer</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01423">user.h:1423</a></div></div>
<div class="ttc" id="aa01881_html"><div class="ttname"><a href="a01881.html">_TL</a></div><div class="ttdef"><b>Definition:</b> <a href="a00257_source.html#l00347">usercli.h:347</a></div></div>
<div class="ttc" id="aa02837_html_a6f224e76b29646c1d8337b2156d9fc5d"><div class="ttname"><a href="a02837.html#a6f224e76b29646c1d8337b2156d9fc5d">tagPOPUPMENU::fFirstClick</a></div><div class="ttdeci">DWORD fFirstClick</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01899">userk.h:1899</a></div></div>
<div class="ttc" id="aa02837_html_acf88a80d20516d7ea2cacfb37b3e7aca"><div class="ttname"><a href="a02837.html#acf88a80d20516d7ea2cacfb37b3e7aca">tagPOPUPMENU::fRightButton</a></div><div class="ttdeci">DWORD fRightButton</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01896">userk.h:1896</a></div></div>
<div class="ttc" id="aa02581_html"><div class="ttname"><a href="a02581.html">tagWND</a></div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01388">user.h:1388</a></div></div>
<div class="ttc" id="aa00851_html_ae82e6ab5253cf5a51f5e270f6b83ccb7"><div class="ttname"><a href="a00851.html#ae82e6ab5253cf5a51f5e270f6b83ccb7">xxxShowWindow</a></div><div class="ttdeci">BOOL xxxShowWindow(PWND pwnd, DWORD cmdShowAnimate)</div><div class="ttdef"><b>Definition:</b> <a href="a00851_source.html#l00081">showwin.c:81</a></div></div>
<div class="ttc" id="aa00788_html_a03fc6648451bec31b72dc096a18dbf6a"><div class="ttname"><a href="a00788.html#a03fc6648451bec31b72dc096a18dbf6a">RECT_ONLEFT</a></div><div class="ttdeci">#define RECT_ONLEFT</div><div class="ttdef"><b>Definition:</b> <a href="a00788_source.html#l00016">mnpopup.c:16</a></div></div>
<div class="ttc" id="aa00371_html_a41f433389f20db57f042022a662e96de"><div class="ttname"><a href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a></div><div class="ttdeci">#define RIP_WARNING</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00029">winerrp.h:29</a></div></div>
<div class="ttc" id="aa02837_html_abb587688f4c843befaed1078fa4848ac"><div class="ttname"><a href="a02837.html#abb587688f4c843befaed1078fa4848ac">tagPOPUPMENU::fDelayedFree</a></div><div class="ttdeci">DWORD fDelayedFree</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01915">userk.h:1915</a></div></div>
<div class="ttc" id="aa02837_html_ad9333cb1b437af71a28e7da0aacaeb13"><div class="ttname"><a href="a02837.html#ad9333cb1b437af71a28e7da0aacaeb13">tagPOPUPMENU::fNoNotify</a></div><div class="ttdeci">DWORD fNoNotify</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01905">userk.h:1905</a></div></div>
<div class="ttc" id="aa00716_html_ac7b5fb8555805e7e7c11b30491a324f7"><div class="ttname"><a href="a00716.html#ac7b5fb8555805e7e7c11b30491a324f7">cy</a></div><div class="ttdeci">int cy[5]</div><div class="ttdef"><b>Definition:</b> <a href="a00716_source.html#l00456">inctlpan.c:456</a></div></div>
<div class="ttc" id="aa00872_html_a71170c4c5e4c60d4bc657fe52eb8d8d2"><div class="ttname"><a href="a00872.html#a71170c4c5e4c60d4bc657fe52eb8d8d2">xxxSetWindowPos</a></div><div class="ttdeci">BOOL xxxSetWindowPos(PWND pwnd, PWND pwndInsertAfter, int x, int y, int cx, int cy, UINT flags)</div><div class="ttdef"><b>Definition:</b> <a href="a00872_source.html#l01169">swp.c:1169</a></div></div>
<div class="ttc" id="aa00635_html_a5a00338a3147879f7fa0ecb4a938cd8c"><div class="ttname"><a href="a00635.html#a5a00338a3147879f7fa0ecb4a938cd8c">xxxDestroyWindow</a></div><div class="ttdeci">BOOL xxxDestroyWindow(PWND pwnd)</div><div class="ttdef"><b>Definition:</b> <a href="a00635_source.html#l01273">createw.c:1273</a></div></div>
<div class="ttc" id="aa02605_html_a263f5b35c44d9f9ae5c74acae8037644"><div class="ttname"><a href="a02605.html#a263f5b35c44d9f9ae5c74acae8037644">tagDISPLAYINFO::rcScreen</a></div><div class="ttdeci">RECT rcScreen</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01570">user.h:1570</a></div></div>
<div class="ttc" id="aa03257_html_a3f749009e2dddfbcdd946cdc60859d5d"><div class="ttname"><a href="a03257.html#a3f749009e2dddfbcdd946cdc60859d5d">gfAnimate</a></div><div class="ttdeci">BOOL gfAnimate</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00019">kernel/globals.c:19</a></div></div>
<div class="ttc" id="aa00617_html_a3376b5eb8ec9b507c26d4420b4b52a25"><div class="ttname"><a href="a00617.html#a3376b5eb8ec9b507c26d4420b4b52a25">xxxReleaseCapture</a></div><div class="ttdeci">BOOL xxxReleaseCapture(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00617_source.html#l00069">capture.c:69</a></div></div>
<div class="ttc" id="aa00788_html_ab3d61a7157cb1c15d4a6e71776948b59"><div class="ttname"><a href="a00788.html#ab3d61a7157cb1c15d4a6e71776948b59">RECT_ONRIGHT</a></div><div class="ttdeci">#define RECT_ONRIGHT</div><div class="ttdef"><b>Definition:</b> <a href="a00788_source.html#l00018">mnpopup.c:18</a></div></div>
<div class="ttc" id="aa00788_html_a4e2a1eb4f026734ecfcc22af567fbf6f"><div class="ttname"><a href="a00788.html#a4e2a1eb4f026734ecfcc22af567fbf6f">RECT_ONTOP</a></div><div class="ttdeci">#define RECT_ONTOP</div><div class="ttdef"><b>Definition:</b> <a href="a00788_source.html#l00017">mnpopup.c:17</a></div></div>
<div class="ttc" id="aa02837_html_ae46449093e4c723bbe342adc37e70387"><div class="ttname"><a href="a02837.html#ae46449093e4c723bbe342adc37e70387">tagPOPUPMENU::ppopupmenuRoot</a></div><div class="ttdeci">struct tagPOPUPMENU * ppopupmenuRoot</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01967">userk.h:1967</a></div></div>
<div class="ttc" id="aa03608_html_afd1a0e78d1f88954d93e48ab3821781f"><div class="ttname"><a href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a></div><div class="ttdeci">typedef UINT(FAR WINAPI *MSGSOUNDPROC)()</div></div>
<div class="ttc" id="aa02837_html_ac9acbfe225a813c1370b19c7ef4fb649"><div class="ttname"><a href="a02837.html#ac9acbfe225a813c1370b19c7ef4fb649">tagPOPUPMENU::fIsTrackPopup</a></div><div class="ttdeci">DWORD fIsTrackPopup</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01892">userk.h:1892</a></div></div>
<div class="ttc" id="aa00788_html_a1eb26f411538728dea46c5b6157046b9"><div class="ttname"><a href="a00788.html#a1eb26f411538728dea46c5b6157046b9">RECT_ONBOTTOM</a></div><div class="ttdeci">#define RECT_ONBOTTOM</div><div class="ttdef"><b>Definition:</b> <a href="a00788_source.html#l00019">mnpopup.c:19</a></div></div>
<div class="ttc" id="aa00899_html_a70b09c3e2b495630f4205d34be505afb"><div class="ttname"><a href="a00899.html#a70b09c3e2b495630f4205d34be505afb">CheckLock</a></div><div class="ttdeci">VOID CheckLock(PVOID pobj)</div></div>
<div class="ttc" id="aa02889_html"><div class="ttname"><a href="a02889.html">tagTHREADINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02260">userk.h:2260</a></div></div>
<div class="ttc" id="aa00935_html_a31ccccdb469eefbb55d18b71a26af0da"><div class="ttname"><a href="a00935.html#a31ccccdb469eefbb55d18b71a26af0da">CopyRect</a></div><div class="ttdeci">BOOL APIENTRY CopyRect(LPRECT prcDst, CONST RECT *prcSrc)</div><div class="ttdef"><b>Definition:</b> <a href="a00935_source.html#l00391">rect.c:391</a></div></div>
<div class="ttc" id="aa00365_html_afec8825ff7db21bd65d8f584c1578258"><div class="ttname"><a href="a00365.html#afec8825ff7db21bd65d8f584c1578258">PPOPUPMENU</a></div><div class="ttdeci">struct tagPOPUPMENU * PPOPUPMENU</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00057">user.h:57</a></div></div>
<div class="ttc" id="aa00788_html_a02a4ecd8aec6051ff2fa9b50d7423650"><div class="ttname"><a href="a00788.html#a02a4ecd8aec6051ff2fa9b50d7423650">TryRect</a></div><div class="ttdeci">BOOL TryRect(UINT wRect, int x, int y, int cx, int cy, LPRECT prcExclude, LPPOINT ppt)</div><div class="ttdef"><b>Definition:</b> <a href="a00788_source.html#l00502">mnpopup.c:502</a></div></div>
<div class="ttc" id="aa00899_html_abe610bfdbc8b5f05880de1fde6ad7abc"><div class="ttname"><a href="a00899.html#abe610bfdbc8b5f05880de1fde6ad7abc">PMENUWND</a></div><div class="ttdeci">struct tagMENUWND * PMENUWND</div></div>
<div class="ttc" id="aa02885_html"><div class="ttname"><a href="a02885.html">tagMENUSTATE</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02242">userk.h:2242</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_885cc87fac2d91e269af0a5a959fa5f6.html">E:</a></li><li class="navelem"><a class="el" href="dir_4e091ed8704426a7a4980368ba259fde.html">git</a></li><li class="navelem"><a class="el" href="dir_cd70cb5eb491250157f2d55d3ff4b13e.html">backup</a></li><li class="navelem"><a class="el" href="dir_ba2b673b566ba104b956abdc6dec0552.html">org</a></li><li class="navelem"><a class="el" href="dir_5bb0003d7907b45051943541418399f5.html">ntuser</a></li><li class="navelem"><a class="el" href="dir_2a0a56546b70a0973705719e6a88eab3.html">kernel</a></li><li class="navelem"><a class="el" href="a00788.html">mnpopup.c</a></li>
    <li class="footer">制作者
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
